{"componentChunkName":"component---node-modules-gatsby-theme-chronoblog-src-templates-post-js","path":"/nightwatchjs-getting-started/","result":{"data":{"mdx":{"id":"cd105a83-b583-5226-89ec-a58a912ddaba","excerpt":"I've been looking at newer browser automation frameworks that might also be written in NodeJS and Nightwatch was a match. So far I've found…","frontmatter":{"title":"Getting started with NightwatchJS","date":"2020-01-12T00:00:00.000Z","description":"I've been looking at newer browser automation frameworks that might also be written in NodeJS and Nightwatch was a match.","tags":["quality assurance","qa","software testing","nightwatchjs","post"],"cover":{"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAABdklEQVQoz5WSy0rDQBSG+wAWL8lck8wkmdpqbk0Ta2m1alUUFUFfQPAVfAV3utWdW+kLdO+yex9CXLl165mkLQVBKvwMZ4bznfkzfyqSEZA7lVxMLqeexSrlRnAmOJecLggD6du8gCmqoWodLUm8BiNn9//hZQLbGIU1//nhfvjydHG4h1aWXXABXhhxqF7L7rIWc7Y1zDHq1u3x6PXj/e32ciBRtSFozcYNSQIXK0tjLid1B8Nh4BKPa01gT4ieQuPR8Pvr8zpXqVrbj9FpZh4k5vmW0Q/NQaLrs9xIFTpOjcgjLUV8Cx6MV3yL9Xf7d1edx5teJ41hfOjik9Q8apqRh/N1BNoJzM4GShVOfNz0CaiAWcXjrOFJmyBqrMIwMCM5VzbddLlkTHLmUHgCWItQqPasP7uMCtxnUdhOk3YzzqJgO01AeRK3oiiLg26ewWE3b8EFguL5IDRsY9NChkOQpFhM5RWBl/Ws+3daGp5vkv/5yX4A+a5ataOUh5AAAAAASUVORK5CYII=","aspectRatio":1.7777777777777777,"src":"/static/981b5554d4aa826892d1758608eaf0bb/c4ecb/nightwatchjsBanner.png","srcSet":"/static/981b5554d4aa826892d1758608eaf0bb/57ab0/nightwatchjsBanner.png 192w,\n/static/981b5554d4aa826892d1758608eaf0bb/f4739/nightwatchjsBanner.png 384w,\n/static/981b5554d4aa826892d1758608eaf0bb/c4ecb/nightwatchjsBanner.png 768w,\n/static/981b5554d4aa826892d1758608eaf0bb/4eab0/nightwatchjsBanner.png 1152w,\n/static/981b5554d4aa826892d1758608eaf0bb/d7771/nightwatchjsBanner.png 1346w","srcWebp":"/static/981b5554d4aa826892d1758608eaf0bb/dd090/nightwatchjsBanner.webp","srcSetWebp":"/static/981b5554d4aa826892d1758608eaf0bb/ae504/nightwatchjsBanner.webp 192w,\n/static/981b5554d4aa826892d1758608eaf0bb/fef30/nightwatchjsBanner.webp 384w,\n/static/981b5554d4aa826892d1758608eaf0bb/dd090/nightwatchjsBanner.webp 768w,\n/static/981b5554d4aa826892d1758608eaf0bb/44170/nightwatchjsBanner.webp 1152w,\n/static/981b5554d4aa826892d1758608eaf0bb/ce310/nightwatchjsBanner.webp 1346w","sizes":"(max-width: 768px) 100vw, 768px","presentationWidth":768,"presentationHeight":434},"resize":{"src":"/static/981b5554d4aa826892d1758608eaf0bb/c4ecb/nightwatchjsBanner.png"}}}},"fields":{"slug":"/nightwatchjs-getting-started/"},"body":"var _excluded = [\"components\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"title\": \"Getting started with NightwatchJS\",\n  \"cover\": \"./nightwatchjsBanner.png\",\n  \"date\": \"2020-01-12T00:00:00.000Z\",\n  \"description\": \"I've been looking at newer browser automation frameworks that might also be written in NodeJS and Nightwatch was a match.\",\n  \"tags\": [\"quality assurance\", \"qa\", \"software testing\", \"nightwatchjs\", \"post\"]\n};\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\nvar Embed = makeShortcode(\"Embed\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"I've been looking at newer browser automation frameworks that might also be written in NodeJS and Nightwatch was a match. So far I've found NightwatchJS to be very quick to get up and running. \"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"NightwatchJS offers built in, easy to use, support for the page object model.\")), mdx(\"p\", null, \"I am a big fan of using the page object model and their use of basically a JSON object to hold the page elements with their selectors seems very organized and natural to me. Below is an example I used for automating a quick test for the Google home page.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"strong\"\n  }, \"Page object model example:\"))), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-js\"\n  }, \"module.exports = {\\n    url: 'http://www.google.com',\\n    elements: {\\n        searchBar: {\\n            selector: 'input[type=text]'\\n        },\\n        submit: {\\n            selector: 'input[name=btnK]'\\n        }\\n    }\\n}\\n\")), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/reallymello/nightwatchExamples\"\n  }, \"Nightwatch example test starter on my GitHub\")), mdx(\"p\", null, \"I go through the Nightwatch installation and creation of my first test in the NightwatchJS tutorial below.\"), mdx(Embed, {\n    src: \"https://www.youtube.com/embed/6Ufg6pPNVTs\",\n    mdxType: \"Embed\"\n  }));\n}\n;\nMDXContent.isMDXComponent = true;"}},"pageContext":{"id":"cd105a83-b583-5226-89ec-a58a912ddaba"}},"staticQueryHashes":["1961101537","2542493696"]}